package a.f.l.a;

import a.c.z;
import a.d.w;
import a.f.ad;

import java.util.Iterator;
import java.util.List;

class jc
  extends sb
{
  private List f;
  private cb g;
  private double h;
  
  protected void c()
  {
    super.c();
    this.f = null;
    this.g = null;
  }
  
  protected void a(qb paramqb)
  {
    super.a(paramqb);
    this.g = paramqb.c().m();
    this.f = new z();
  }
  
  protected void b(rb paramrb)
  {
    super.b(paramrb);
    f(paramrb);
  }
  
  private void f(rb paramrb)
  {
    boolean bool2 = sb.e;
    int j = sb.d;
    o localo = b().e();
    double d1 = localo.d();
    int i = localo.f().j();
    if ((bool2) || (i > 0)) {
      if (bool2) {}
    }
    boolean bool1 = d1 > 0.0D;
    mb localmb = paramrb.i();
    this.f.clear();
    r localr = a().a(paramrb.d());
    Object localObject1 = (bool2) || (localr != null) ? localr.c(false) : null;
    Object localObject2;
    Object localObject3;
    jb localjb;
    Object localObject4;
    if (!bool2) {
      if (localObject1 != null)
      {
        localObject2 = localObject1.iterator();
        label311:
        do
        {
          do
          {
            if (!((Iterator)localObject2).hasNext()) {
              break label314;
            }
            localObject3 = (ad)((Iterator)localObject2).next();
            if ((!bool2) && (j != 0)) {
              break label328;
            }
            if (((ad)localObject3).a() == 255)
            {
              if (bool2) {
                break label323;
              }
              this.f.clear();
              if (j == 0) {
                break label314;
              }
            }
            localjb = localmb.a(mb.a_.a((ad)localObject3));
            if (bool2) {
              break label311;
            }
            if (!((ad)localObject3).b()) {
              break;
            }
            localObject4 = localr.a((ad)localObject3, false);
            double d2 = localjb.a() ? ((w)localObject4).b() : ((w)localObject4).a();
            this.f.add(new jb(d2, d2, localjb.f(), localjb.a()));
            if (bool2) {
              break label311;
            }
          } while (j == 0);
          this.f.add(a(localjb, bool1, d1));
        } while (j == 0);
      }
    }
    label314:
    label323:
    if ((!bool2) && (this.f.isEmpty()))
    {
      label328:
      localObject2 = localmb.a(mb.a_.a);
      localObject3 = localmb.a(mb.a_.b);
      localjb = localmb.a(mb.a_.d);
      localObject4 = localmb.a(mb.a_.c);
      this.f.add(a((jb)localObject2, bool1, d1));
      this.f.add(a((jb)localObject3, bool1, d1));
      this.f.add(a((jb)localObject4, bool1, d1));
      this.f.add(a(localjb, bool1, d1));
    }
  }
  
  private jb a(jb paramjb, boolean paramBoolean, double paramDouble)
  {
    boolean bool = sb.e;
    if (!bool)
    {
      if (paramBoolean) {
        if (bool) {
          break label61;
        }
      }
    }
    else if (paramjb.d() > 2.0D * paramDouble) {
      return new jb(paramjb.b() + paramDouble, paramjb.c() - paramDouble, paramjb.f(), paramjb.a());
    }
    label61:
    return paramjb;
  }
  
  double[] a(h paramh, mb parammb, jb[] paramArrayOfjb, m[] paramArrayOfm, double[] paramArrayOfDouble)
  {
    boolean bool = sb.e;
    if (paramh.d() == null)
    {
      b("distance penalty", 0.0D, false);
      return new double[paramArrayOfjb.length];
    }
    this.h = 0.0D;
    if (!bool) {
      if ((this.g != null) && (paramArrayOfm[0].e() == 3))
      {
        mb localmb = paramh.a();
        jb localjb = a(localmb, paramArrayOfjb[0].a());
        if (bool) {
          break label119;
        }
        if (this.g.a(localjb)) {
          this.h += 2.0D * this.g.c(paramArrayOfjb[0].f(), localjb);
        }
      }
    }
    label119:
    return super.a(paramh, parammb, paramArrayOfjb, paramArrayOfm, paramArrayOfDouble);
  }
  
  protected double a(h paramh, mb parammb, jb paramjb, m paramm, double paramDouble)
  {
    double d1 = this.h;
    jb localjb1 = d(paramh);
    if ((sb.e) || (localjb1 != null))
    {
      jb localjb2 = a(paramjb, localjb1);
      d1 += localjb1.c(localjb2);
    }
    double d2 = d1 / b().j();
    a("distance penalty", d2, false);
    return d2;
  }
  
  private jb a(jb paramjb1, jb paramjb2)
  {
    if (!sb.e) {
      if (paramjb1.a() == paramjb2.a()) {
        return b(paramjb2, paramjb1);
      }
    }
    return c(paramjb2, paramjb1);
  }
  
  private jb d(h paramh)
  {
    boolean bool = sb.e;
    jb localjb = paramh.h();
    if (!bool) {
      if (localjb == null)
      {
        localjb = e(paramh);
        if (!bool) {
          if (localjb != null)
          {
            if (bool) {
              break label47;
            }
            paramh.c(localjb);
            if (sb.d == 0) {
              return localjb;
            }
          }
        }
        label47:
        localjb = paramh.c();
      }
    }
    return localjb;
  }
  
  private jb e(h paramh)
  {
    h localh = paramh.b();
    jb localjb = localh != null ? d(localh) : null;
    if ((sb.e) || (localjb != null)) {
      return a(paramh.c(), localjb);
    }
    return null;
  }
  
  protected double b(h paramh)
  {
    boolean bool = sb.e;
    int i = sb.d;
    double d1 = 0.0D;
    if (!bool)
    {
      if (!this.f.isEmpty()) {
        d1 = 1.7976931348623157E+308D;
      }
    }
    else
    {
      jb localjb1 = d(paramh);
      Iterator localIterator = this.f.iterator();
      do
      {
        do
        {
          double d3;
          do
          {
            if (!localIterator.hasNext()) {
              break;
            }
            jb localjb2 = (jb)localIterator.next();
            d3 = localjb1.c(localjb2);
          } while (d3 >= d1);
          if (bool) {
            break label113;
          }
          if (i != 0) {
            break label121;
          }
          d1 = d3;
        } while (bool);
      } while (i == 0);
    }
    label113:
    label121:
    double d2 = d1 / b().j();
    a("HEUR distance penalty", d1 / b().j(), true);
    return d2;
  }
  
  private jb b(jb paramjb1, jb paramjb2)
  {
    boolean bool2 = sb.e;
    double d1 = paramjb2.f();
    boolean bool1 = paramjb2.a();
    if (!bool2) {
      if (paramjb1.d() == 0.0D)
      {
        double d2 = paramjb2.e().c(paramjb1.b());
        if (((bool2) || (this.g != null)) && ((bool2) || (this.g.a(paramjb2)))) {
          d2 = this.g.a(d2, paramjb2);
        }
        return new jb(d2, d2, d1, bool1);
      }
    }
    eb localeb1 = eb.a(paramjb1.e(), paramjb2.e());
    if (localeb1 == null)
    {
      if (!bool2) {}
      double d3 = paramjb1.b() > paramjb2.c() ? paramjb1.b() : paramjb1.c();
      double d5 = paramjb2.e().c(d3);
      if (((bool2) || (this.g != null)) && ((bool2) || (this.g.a(paramjb2)))) {
        d5 = this.g.a(d5, paramjb2);
      }
      return new jb(d5, d5, d1, bool1);
    }
    if (!bool2) {
      if (this.g == null) {
        return new jb(localeb1, d1, bool1);
      }
    }
    if (!bool2) {}
    if (!bool2) {
      if (this.g.a(localeb1, !bool1))
      {
        if (!bool2) {}
        eb localeb2 = this.g.b(localeb1, !bool1);
        return new jb(localeb2, d1, bool1);
      }
    }
    if ((bool2) || (this.g.a(paramjb2)))
    {
      double d4 = this.g.a(paramjb1.b(), paramjb2);
      return new jb(d4, d4, d1, bool1);
    }
    return new jb(localeb1, d1, bool1);
  }
  
  private jb c(jb paramjb1, jb paramjb2)
  {
    boolean bool = sb.e;
    double d = paramjb2.e().c(paramjb1.f());
    if (((bool) || (this.g != null)) && ((bool) || (this.g.a(paramjb2)))) {
      d = this.g.a(d, paramjb2);
    }
    return new jb(d, d, paramjb2.f(), paramjb2.a());
  }
  
  private jb a(mb parammb, boolean paramBoolean)
  {
    mb.a_ locala_ = paramBoolean ? mb.a_.a : mb.a_.d;
    return parammb.a(locala_);
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.l.a.jc

 * JD-Core Version:    0.7.0.1

 */